#include <stdio.h>

#define max 12

int erfenfind(int *arr,int inputnum);
int main(int argc, const char *argv[])
{
	int arr[max]={0,11,22,33,44,55,66,77,88,99,101,266};
	int inputnum;
	scanf("%d",&inputnum);

	int flag=erfenfind(arr,inputnum);
	if(flag==-1)
	{
		printf("error\n");
	}
	if(flag>=0)
	{
		printf("good pos is %d\n",flag);
	}	
	
	return 0;
}

int erfenfind(int *arr,int inputnum)
{
	int flag=-1;
	int left=0;
	int right=max-1;
	int mid=(left+right)/2;

	while(inputnum>=arr[left]&&inputnum<=arr[right])
	{
		if(left+1==right&&inputnum!=arr[left]&&inputnum!=arr[right])
		{
			flag=-1;
			break;
		}
		if(inputnum==arr[left])
		{
			flag=left;
			break;
		}
		if(inputnum==arr[right])
		{
			flag=right;
			printf("right!\n");
			break;
		}
		if(inputnum==arr[mid])
		{

			flag=mid;
			break;
		}
		if(inputnum>arr[mid])
		{
			left=mid;
			mid=(right+left)/2;
			continue;
		}
		if(inputnum<arr[mid])
		{
			right=mid;
			mid=(right+left)/2;
			continue;
		}

	}

	return flag;

}
